home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Varsity Update 1998 August
/
SGI Varsity Update 1998 August.iso
/
dist
/
dist6.5
/
il_dev.idb
/
usr
/
include
/
il
/
ilHwMatrix.h.z
/
ilHwMatrix.h
Wrap
C/C++ Source or Header
|
1998-07-29
|
2KB
|
72 lines
#if 0
Copyright (c) 1991 SGI All Rights Reserved
THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
The copyright notice above does not evidence any
actual or intended publication of such source code,
and is an unpublished work by Silicon Graphics, Inc.
This material contains CONFIDENTIAL INFORMATION that
is the property of Silicon Graphics, Inc. Any use,
duplication or disclosure not specifically authorized
by Silicon Graphics is strictly prohibited.
RESTRICTED RIGHTS LEGEND:
Use, duplication or disclosure by the Government is
subject to restrictions as set forth in subdivision
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 52.227-7013, and/or in similar
or successor clauses in the FAR, DOD or NASA FAR
Supplement. Unpublished- rights reserved under the
Copyright Laws of the United States. Contractor is
SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
Mountain View, CA 94039-7311
#endif
#ifndef _ilHwMatrix_h_
#define _ilHwMatrix_h_
#include <GL/gl.h>
#include <bstring.h>
#include <il/ilDefs.h>
class ilPerspWarp;
class ilHwMatrix {
public:
enum MatState { unknown, identity, other };
ilHwMatrix() { state = unknown; }
void operator=(const ilHwMatrix &mat)
{
if (mat.state == identity)
state = identity;
else {
bcopy(mat.glMat, glMat, sizeof(glMat));
state = other;
}
}
int operator!=(const ilHwMatrix& mat)
{
// the objects are equal only if both states are identity, or
// if both states are other and the matrix values are equal
return (state != mat.state) || (state == unknown) ||
(state == other) && bcmp(mat.glMat, glMat, sizeof(glMat));
}
void init(const ilPerspWarp& warp);
// Pads out matrices to 4x4
void init(const float* mat = NULL, int rows = 4, int cols = 4,
int transpose = 0);
MatState state;
GLfloat glMat[16];
void scale(float s);
};
#endif